<template>
  <!-- 原材自动消耗设置 -->
  <div class="automaticConsumption">
    <el-form ref="form" :model="form" :rules="rules">
      <el-row>
        <el-col :span="24">
          <el-form-item prop="workArea">
            <el-switch v-model="form.delivery"></el-switch>
            <span style="margin-left: 10px;">开启原材自动消耗</span>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item prop="workArea">
            <el-radio-group v-model="form.workArea">
              <el-radio label="匹配所有批次钢筋"></el-radio>
              <el-radio label="只限匹配含实验报告批次的钢筋"></el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <div class="tips">提示：在开启自动消耗后，系统在生产时会自动扣减原材库存量，不建议工人使用手持设备扫码</div>
        </el-col>
      </el-row>
    </el-form>
    <div class="submitForm">
      <el-button type="primary" @click="submitForm">保存</el-button>
    </div>
  </div>
</template>

<script>
export default {
  name: "AutomaticConsumption",
  components: {},
  props: {},
  data() {
    return {
      form: {},
      rules: {
        workArea: [
          { required: true, message: "不能为空", trigger: "blur" },
        ],
      },
    };
  },
  filters: {},
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  beforeDestroy() {},
  methods: {
    submitForm() {
      this.$refs['form'].validate(valid => {
        if (valid) {
          console.log(this.form)
        }
      })
    },
  },
};
</script>

<style scoped lang="scss">
.automaticConsumption {
  width: 50%;
}
</style>
